const KoaRouter = require('@koa/router')

const router = new KoaRouter({})
const checkToken = require('../middleware/checkToken')

//  引入user控制器
const U = require('../controller/user')
const G = require('../controller/good')
const A = require('../controller/addr')
const v = '/api/v1'
router
  .post(`${v}/user/login`, U.login)
  .post(`${v}/user/info`,U.info)
  .get(`${v}/good/detail`,G.shoppdetail)
  .get(`${v}/good/list`, G.goodlist)
  .get(`${v}/good/cate`, G.goodcate)
  .get(`${v}/addr/list`,checkToken,A.addrlist)
  .post(`${v}/addr/add`,checkToken,A.addradd)
  .post(`${v}/addr/del`,A.addrdel)
module.exports = router
